Document editing tools often offer text completion features that allow an author to type a small amount of text, such as the beginning of a word, and insert a larger amount of text. For example, Microsoft Word includes AutoCorrect, which authors can use to store whole paragraphs of text that authors can insert by typing a single word or string of characters. For example, type the text “copyright” might insert a standard copyright disclaimer for a law office. Similarly, software development tools, such as Microsoft Visual Studio, provide the ability to view words that begin with typed letters as the developer types one or more letters. For example, Microsoft Visual Studio includes IntelliSense, which collects symbols by compiling an application program and enumerating a tree representation of the application program's source code. As the user types the first letters of a symbol, the user can press Tab or another key to insert the full text of the symbol.
Editor aides (such as code completion) generally rely on parsing to collect information about the schema of the code. This schema includes, but is not limited to global objects/methods, arguments for methods, type information, local variables, and their scope. Parsing (static analysis) is generally sufficient for collecting all of the schematic information needed from statically typed languages. Since statically typed languages generally do not allow modification of types (major component of the schema) at run-time, by parsing the static text of the code, one can reliably deduce what the final types will look like. For languages that are not statically typed, static analysis may not discover many code elements, so that they are unavailable for code completion. For example, consider the following code.
for( i=0; i< length; i++ ){  a[“a” + i] = I;}
The variables a.a0 and a.a1 are in the list at run time, but are not statically discoverable. As another example, the following is common in Asynchronous JavaScript and XML (AJAX) code. Executing the following code creates the class named “Foo,” which is not statically discoverable.
CreateClass( “Foo” )  this[ name ] = {. . .}
Execution of the code (dynamic analysis) can be performed to determine the complete picture of the schema of the code. For example, Microsoft Visual Studio 2008 performs static analysis on a current file and dynamic analysis on any included or referenced files. The dynamic results are then converted into data structures similar to the static results, a limited and error-prone process.
Analysis by execution has several problems. First, execution of large amounts of code, such as may be encountered in references to multiple code files, can be slower than an interactive user interface typically allows. For example, a single file may reference dozens of other files. Second, executed code may contain infinite loops, infinite recursion, or complex code that does not terminate or terminates in an unpredictable length of time. Code that is being edited is often in an intermediate state that is not stable or correct according to the author's ultimate purpose. This can lead to long execution times or even code paths that do not end. Third, scoping rules may cause sections of code to avoid execution and may limit results. For example, an analysis system may assume that an unknown variable has a particular value that leads to incomplete coverage of the code (e.g., because a branch is not followed when the variable has the chosen value).